﻿namespace MetroControlProvider
{
    using System;
    using System.IO;
    using System.Windows.Forms;

    using Creek.UI.EFML;
    using Creek.UI.EFML.Base;
    using Creek.UI.EFML.Base.Controls;
    using Creek.UI.EFML.Base.Controls.Navigator;
    using Creek.UI.Metro.Controls;
    using Creek.UI.Metro.MessageBox;

    public class Provider : ControlProvider
    {
        public Provider()
        {
            Assembly = File.ReadAllBytes(typeof(Provider).Assembly.Location);

            ScriptingTypes.Add(typeof(MetroMessageBox));
            ScriptingFuncs.Add("function alert(msg) {MetroMessageBox.Show(parent, msg);}");

            this.Add<Creek.UI.Metro.Forms.MetroForm>(Tag.Window);
            this.Add<MetroLabel>(Tag.Label);
            this.Add<MetroButton>(Tag.Button);
            this.Add<MetroCheckBox>(Tag.Checkbox);
            this.Add<MetroComboBox>(Tag.Dropdown);
            this.Add<MetroLink>(Tag.Link);
            this.Add<MetroRadioButton>(Tag.Radiobutton);
            this.Add<MetroTextBox>(Tag.Textbox);
            this.Add<MetroPanel>(Tag.Div);
            this.Add<PageNavigator>(Tag.Navigator);
            this.Add<Line>(Tag.Line);
            this.Add<MetroPanel>(Tag.Break);
            this.Add<WebBrowser>(Tag.WebView);

            this.Save(
                new FileStream(
                    Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\metro.cp", FileMode.OpenOrCreate));
        }
    }
}